package com.ehi.alliance.resource;

import com.ehi.alliance.service.AllianceService;
import com.ehi.common.domain.alliance.AllianceInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

@Component
@Path("/echo")
public class Echo {

    @Autowired
    private AllianceService allianceService;

    @GET
    public String echo() {
        return "Hello Spring Boot";
    }

    @GET
    @Path("/city")
    @Produces(MediaType.APPLICATION_JSON)
    public AllianceInfo getAllianceInfo() {
        return allianceService.getByAllianceId("5");
    }
}
